<?php
/**
 * 提现管理控制中心
 * User：LLW
 * Date：2020-04-08
 * Time：8：51
 */

namespace app\caidongweb\controller;

use app\caidongweb\model\CashModel;
use app\caidongweb\model\CashTypeModel;
use think\Request;

class Cash extends BaseController
{
    //初始化程序
    public function __construct(Request $request = null)
    {
        parent::__construct();
        $this->cash = new CashModel();
        $this->caty = new CashTypeModel();
    }

    /**
     * 提现首页
     * @return \think\response\View
     */
    public function CashList()
    {
        $list = $this->cash->getList();
        $this->assign('list',$list);
        $this->assign('page',$list->render());
        return view();
    }

    /**
     * @return array|\think\response\View
     */
    public function CashState()
    {
        if(input('post.')){
            $res = $this->cash->getState();
            return $res;
        }
        $id = input('id');
        $this->assign('id',$id);
        return view();
    }

    public function CashComplete()
    {
        $list = $this->cash->getList(array('neq',0));
        $this->assign('list',$list);
        $this->assign('page',$list->render());
        return view();
    }

    public function CashType()
    {
        $list = $this->caty->getList();
        $this->assign('list',$list);
        $this->assign('page',$list->render());
        return view();
    }

    public function CashTypeYes()
    {
        $res = $this->caty->getState();
        return $res;
    }
}